const joi = require('@hapi/joi')

//验证格式为字符串，格式为数字和字母，长度在6-12之间，必填项
const username = joi.string().alphanum().min(4).max(10).required()

const password = joi.string().pattern(/^[\S]{6,12}$/).required()

const userRuler = {
    body: {
        username,
        password
    }
}

module.exports = userRuler